import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
import createPersistedState from 'vuex-persistedstate'
export default new Vuex.Store({
    state: {
        CategoryList: [],
        QuestionMap: {},
    },
    mutations: {
        updateCategoryList(state, list) {
            state.CategoryList = list;
        },
        updateQuestionMap(state, { key, val }) {
            state.QuestionMap = {
                ...state.QuestionMap,
                [key]: val,
            };
        },
    },
    actions: {},
    plugins: [createPersistedState()]
});